package com.niit.online_music.controller;

import com.niit.online_music.entity.Admin;
import com.niit.online_music.service.AdminService;
import com.niit.online_music.util.Result;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ProjectName: online_music
 * @Package: com.niit.online_music.controller
 * @ClassName: AdminController
 * @Author: zjh
 * @description: TODO
 * @date: 2024/1/17 10:57
 * @version: 1.0
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    private AdminService adminService;
    @Autowired
    public void setAdminService(AdminService adminService) {
        this.adminService = adminService;
    }

    //判断是否登录成功
    @PostMapping("/login")
    public Result loginStatus(Admin admin, HttpSession httpSession){
        return adminService.verityPasswd(admin,httpSession);
    }
}
